<div class="nodesSort">
<?php foreach (array('all' => _('List all'), 'published' => _('List published'), 'upcoming' => _('List upcoming'), 'hidden' => _('List hidden'), 'nocategory' => _('List non-categorized')) as $select_key => $select_label):?>
<?php   if ($select_key == @$requested_select):?>
  <span class="nodesSortCurrent"><?php _h($select_label);?></span> |
<?php   else:?>
<?php link_to_remote($select_label, 'xigg-admin-node-list', array('base' => '/node/list', 'params' => array('select' => $select_key, 'sortby' => $requested_sortby)));?>
  |
<?php   endif;?>
<?php endforeach;?>
<?php _e('Sort by ');select_to_remote('sortby', $requested_sortby, 'xigg-admin-node-list', array('created,DESC' => _('Posted date'), 'published,DESC' => _('Published date'), 'views,DESC' => _('View count'), 'category_id,ASC' => _('Category'), 'status,ASC' => _('Status'), 'comment_count,DESC' => _('Comments'), 'trackback_count,DESC' => _('Trackbacks'), 'vote_count,DESC' => _('Votes')), array('base' => '/node/list', 'params' => array('select' => $requested_select)), _('Go'), 'xigg-admin-node-list-select');?>
</div>
<?php form_tag('post', Sabai_URL::get('/node/submit'), array('id' => 'xigg-admin-node-list-form'));?>
  <table>
    <thead>
      <tr>
        <th><input id="xigg-admin-node-list-form-checkall" type="checkbox" onclick="$$('#xigg-admin-node-list-form input.check').each(function(ele){ele.checked=$('xigg-admin-node-list-form-checkall').checked});" /></th>
        <th>&nbsp;</th>
        <th class="left"><?php _e('Title');?></th>
        <th class="left"><?php _e('Source');?></th>
        <th class="left"><?php _e('Category');?></th>
        <th><?php _e('Created');?></th>
        <th><?php _e('Published');?></th>
        <th><?php _e('Views');?></th>
        <th><?php _e('Comments');?></th>
        <th><?php _e('Trackbacks');?></th>
        <th><?php _e('Votes');?></th>
        <th><?php _e('Priority');?></th>
        <th scope="col"><?php _e('Action');?></th>
      </tr>
    </thead>
    <tfoot>
      <tr>
        <td colspan="4" class="left">
<?php if ($requested_select != 'published'):?>
          <input type="submit" name="publish" value="<?php _e('Publish');?>" />
<?php endif;?>
<?php if ($requested_select != 'hidden'):?>
          <input type="submit" name="hide" value="<?php _e('Hide');?>" />
<?php endif;?>
          <input type="submit" name="unhide" value="<?php _e('Unhide');?>" />
          <input type="submit" name="delete" value="<?php _e('Delete');?>" />
        </td>
        <td colspan="9" class="right"><?php echo $this->helper('PageNavRemote', 'xigg-admin-node-list', $entity_pages, $entity_page_requested, array('base' => '/node/list', 'params' => array('sortby' => $requested_sortby, 'select' => $requested_select)));?></td>
      </tr>
    </tfoot>
    <tbody>
<?php while ($e =& $entity_objects->getNext()):?>
<?php   if ($e->isHidden()):?>
      <tr style="background-color:#eee;">
<?php   else:?>
      <tr>
<?php   endif;?>
        <td><input type="checkbox" class="check" name="nodes[]" value="<?php echo $e->getId();?>" /></td>
        <td><?php if ($e->isPublished()):?><img src="<?php echo $LAYOUT_URL;?>/images/tick.gif" alt="" /><?php endif;?></td>
        <td class="left"><a href="<?php echo Sabai_URL::getByScript('index.php', '/node/' . $e->getId());?>"><?php _h(Sabai_I18N::strcutMore($e->getLabel(), 100));?></a></td>
        <td class="left"><?php echo $e->getSourceHTMLLink(40);?></td>
        <td class="left"><?php if ($category =& $e->get('Category')):?><a href="<?php echo Sabai_URL::getByScript('index.php', '/', array('category_id' => $category->getId()));?>"><?php _h($category->getLabel());?></a><?php endif;?></td>
        <td><?php _h($this->helper('XiggAgo', $e->getTimeCreated()));?></td>
        <td><?php if ($e->isPublished()) {_h($this->helper('XiggAgo', $e->get('published')));}?></td>
        <td><?php echo $e->get('views');?></td>
        <td><?php link_to_remote($e->getCommentCount(), 'xigg-admin-node-comment-list', array('base' => '/node/' . $e->getId() . '/comment'));?></td>
        <td><?php link_to_remote($e->getTrackbackCount(), 'xigg-admin-node-trackback-list', array('base' => '/node/' . $e->getId() . '/trackback'));?></td>
        <td><?php link_to_remote($e->getVoteCount(), 'xigg-admin-node-vote-list', array('base' => '/node/' . $e->getId() . '/vote'));?></td>
        <td><?php echo $e->get('priority');?></td>
        <td><?php link_to_remote(_('Edit'), 'xigg-admin-node-update', array('base' => '/node/' . $e->getId() . '/edit'));?></td>
      </tr>
<?php endwhile; ?>
    </tbody>
  </table>
<input type="hidden" name="_TOKEN" value="<?php echo $this->helper('Token', 'Admin_node_submit');?>" />
<?php form_tag_end();?>
<div id="xigg-admin-node-update"></div>
<div id="xigg-admin-node-comment-list"></div>
<div id="xigg-admin-node-trackback-list"></div>
<div id="xigg-admin-node-vote-list"></div>